<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>css-dom 操作</title>
  <script type="text/javascript" src="../script/jquery-3.6.0.min.js"></script>
  <script type="text/javascript">
    $(function () {
      $("#b1").click(function () {
        var width = $("img").width();
        alert(width)
        var offset = $("img").offset();
        alert("offset.top="+offset.top)
        alert("offset.left="+offset.left)

      })
    })
  </script>
</head>
<body>
<br/><br/><br/>
hello,world~<img src="../image/1.png" width="200">
<button id="b1" type="button">获取图片信息</button>
</body>
</html>